/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright @ Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: Header file for kernel hot upgrade.
 */
#ifndef _LINUX_HOTUPGRADE_H
#define _LINUX_HOTUPGRADE_H

#ifdef CONFIG_KEXEC_KERNEL_HOTUPGRADE
#ifndef __ASSEMBLY__
#include <linux/types.h>

extern bool initcall_delaying;
extern u64 kernel_hotupgrade;
#define HOTUPGRADE_WITH(flag)	(kernel_hotupgrade & flag)

extern int free_init_mem(void *unused);
extern void free_init_mem_async(void);
#endif
#else
#define HOTUPGRADE_WITH(flag)	false
#endif

#define UPGRADE_F_SRIOV_INHERIT		0x01
#define UPGRADE_F_SKIP_VIRTIO_PROBE	0x02
#define UPGRADE_F_SKIP_ACPI_COMPANION	0x04
#define UPGRADE_F_SKIP_HPET_RESET	0x08
#define UPGRADE_F_SKIP_CPU_MTRR_SET	0x10
#define UPGRADE_F_DISABLE_ACPI_PDC	0x20
#define UPGRADE_F_ASYNC_POP_ROOTFS	0x40
#define UPGRADE_F_ASYNC_FREE_INITMEM	0x80
#define UPGRADE_F_DELAY_INITCALL	0x100
#define UPGRADE_F_IOMMU_LIVE		0x200
#define UPGRADE_F_VPMEM_PERSIST		0x400
#define UPGRADE_F_VPAGE_ALLOC		0x800

#endif /* _LINUX_HOTUPGRADE_H */
